#include<stdio.h>
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
	int i, n, id[1000], s1[1000], s2[1000], s3[1000], s4[1000], s5[1000];
	float sum[10] = { 0 };
	cin >> n;
	for (i = 0; i < n; i++)
		cin >> id[i] >> s1[i] >> s2[i] >> s3[i] >> s4[i] >> s5[i];
	for (i = 0; i < n; i++)
	{
		cout << id[i] << " " << s1[i] << " " << s2[i] << " " << s3[i] << " " << s4[i] << " " << s5[i] << " ";
		printf("%.1f\n", (float)(s1[i] + s2[i] + s3[i] + s4[i] + s5[i]) / 5);
	}
	for (i = 0; i < n; i++)
	{
		sum[0] += s1[i];
		sum[1] += s2[i];
		sum[2] += s3[i];
		sum[3] += s4[i];
		sum[4] += s5[i];
	}
	printf("%.1f %.1f %.1f %.1f %.1f\n", (float)sum[0] / n,(float)sum[1] / n, (float)sum[2] / n, (float)sum[3] / n, (float)sum[4] / n);
	return 0;
}